import {asyncAny,fetchPath} from 'tsservice/commonService';

namespace _TestAdd{
  type Params = {name:string,id?:string};
  type Result = {returnNo:number,returnMsg:string,result?:string};
  export function req(params:Params){
    return asyncAny<Result>(fetchPath('/test/add',params), 'POST', { params });
  }
};
export const TestAdd = _TestAdd.req;

namespace _TestModify{
  type Params = {name:string,id?:string};
  type Result = {returnNo:number,returnMsg:string,result?:boolean};
  export function req(params:Params){
    return asyncAny<Result>(fetchPath('/test/modify',params), 'POST', { params });
  }
};
export const TestModify = _TestModify.req;

namespace _TestQuery{
  type Params = {};
  type Result = {returnNo:number,returnMsg:string,result:{name?:string,id:string}[]};
  export function req(params:Params){
    return asyncAny<Result>(fetchPath('/test/query',params), 'GET', { params });
  }
};
export const TestQuery = _TestQuery.req;

namespace _TestFetch{
  type Params = {id?:string};
  type Result = {returnNo:number,returnMsg:string,result?:{name?:string,id:string}};
  export function req(params:Params){
    return asyncAny<Result>(fetchPath('/test/fetch',params), 'GET', { params });
  }
};
export const TestFetch = _TestFetch.req;

namespace _TestDelete{
  type Params = {id?:string[]};
  type Result = {returnNo:number,returnMsg:string,result?:boolean};
  export function req(params:Params){
    return asyncAny<Result>(fetchPath('/test/delete',params), 'POST', { params });
  }
};
export const TestDelete = _TestDelete.req;
